import React, { Component } from 'react'

export default class App extends Component {

    state = {
        list: ['11', '22', '33'],
        show: false
    }
    render() {
        return (
            <div>
                <ul>
                    {this.state.list.map((item, index) => <li key={index}>{item}</li>)}
                </ul>
                <button onClick={() => {
                    this.setState({
                        show: !this.state.show
                    })
                }}>展示</button>
                {this.state.show ? <div>ziduan</div> : null}
            </div>
        )
    }
}
//key 值的增加是为了节省对比效率 提高列表的服用，提高性能
